<html>
<head><meta charset="utf-8"><title>file not included in module tree · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/file.20not.20included.20in.20module.20tree.html">file not included in module tree</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="231088601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/file%20not%20included%20in%20module%20tree/near/231088601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/file.20not.20included.20in.20module.20tree.html#231088601">(Mar 19 2021 at 20:55)</a>:</h4>
<p>I'm getting this error, but I don't really know why and I'm not sure what it's talking about.</p>



<a name="231091517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/file%20not%20included%20in%20module%20tree/near/231091517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/file.20not.20included.20in.20module.20tree.html#231091517">(Mar 19 2021 at 21:18)</a>:</h4>
<p>That just means that the file you are viewing isn't <code>mod</code> declared in the workspace and therefor not in the module tree. We emit this warning for files as we do not analyze those.</p>



<a name="231095859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/file%20not%20included%20in%20module%20tree/near/231095859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/file.20not.20included.20in.20module.20tree.html#231095859">(Mar 19 2021 at 22:02)</a>:</h4>
<p>any way we could improve the wording here?</p>



<a name="231141967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/file%20not%20included%20in%20module%20tree/near/231141967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/file.20not.20included.20in.20module.20tree.html#231141967">(Mar 20 2021 at 11:55)</a>:</h4>
<p>Sorry, I should have mentioned that this is for my <a href="http://lib.rs">lib.rs</a>.</p>



<a name="231143887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/file%20not%20included%20in%20module%20tree/near/231143887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/file.20not.20included.20in.20module.20tree.html#231143887">(Mar 20 2021 at 12:34)</a>:</h4>
<p><a href="/user_uploads/4715/B1avRs8TUU2bzbXJNE8Cc6rG/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/B1avRs8TUU2bzbXJNE8Cc6rG/image.png" title="image.png"><img src="/user_uploads/4715/B1avRs8TUU2bzbXJNE8Cc6rG/image.png"></a></div>



<a name="231158523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/file%20not%20included%20in%20module%20tree/near/231158523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/file.20not.20included.20in.20module.20tree.html#231158523">(Mar 20 2021 at 17:14)</a>:</h4>
<p>Ah. The problem was that I imported one project/directory into emacs (<code>foo</code>) then moved another project inside of it (<code>foo/bar</code>). Thus emacs / LSP-mode was running rust-analyzer rooted up one directory.</p>



<a name="231158548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/file%20not%20included%20in%20module%20tree/near/231158548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/file.20not.20included.20in.20module.20tree.html#231158548">(Mar 20 2021 at 17:15)</a>:</h4>
<p>The fix was to manually say that this directory was it's own thing (<code>lsp-workspace-folders-add</code>)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>